home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ABUSESRC.ZIP / AbuseSrc / macabuse / imlib / port / sgi / timing.c < prev   
C/C++ Source or Header  |  1997-05-20  |  666b  |  34 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <sys/time.h>
  4. #include <unistd.h>
  5. #include "timing.hpp"
  6.  
  7. void timer_init() { ; }
  8. void timer_uninit() { ; }
  9.  
  10. double time_marker::diff_time(time_marker *other)
  11. {  
  12.   return (double)(seconds-other->seconds)+  
  13.      (double)(micro_seconds-other->micro_seconds)/1000000;
  14. }
  15.  
  16.  
  17. void time_marker::get_time()
  18. {
  19.   struct timezone tz={0,DST_USA};     
  20.   gettimeofday((struct timeval *)&seconds,&tz);
  21. }
  22.  
  23. time_marker::time_marker()
  24.   struct timezone tz={0,DST_USA};     
  25.   gettimeofday((struct timeval *)&seconds,&tz);
  26. }
  27.  
  28. void milli_wait(unsigned wait_time)
  29. {
  30.   sginap(wait_time*sysconf(3)/1000);
  31. }
  32.  
  33.